package com.ilink.groundservice.entity.VO.langflowApp;

import com.fasterxml.jackson.databind.JsonNode;
import com.ilink.groundservice.entity.PO.langflowApp.StoreFlow;
import com.ilink.groundservice.entity.PO.model.ModelLangflow;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class DownloadFlowResult implements Serializable {

    private static final long serialVersionUID = 1L;
    private String flowId;
    private String flowName;
    private String description;
    private JsonNode data;
    private Boolean component;
    private JsonNode metaData;

    public static DownloadFlowResult from(StoreFlow storeFlow)  {
        return new DownloadFlowResult(
                storeFlow.getFlowId(),
                storeFlow.getFlowName(),
                storeFlow.getDescription(),
                storeFlow.getData(),
                storeFlow.getComponent(),
                storeFlow.getMetaData()
        );
    }

    public static DownloadFlowResult from(ModelLangflow modelLangflow)  {
        return new DownloadFlowResult(
            modelLangflow.getModelId(),
            modelLangflow.getModelName(),
            modelLangflow.getDescription(),
            modelLangflow.getData(),
            false,
            null
        );
    }

}
